home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Amiga Collections: MegaDisc
/
MegaDisc 15 (1990)(MegaDisc Digital Publishing)(AU)[WB][reissue].zip
/
MegaDisc 15 (1990)(MegaDisc Digital Publishing)(AU)[WB][reissue].adf
/
Programs
/
asciitable.bas
< prev
next >
Wrap
BASIC Source File
|
1989-12-27
|
2KB
|
78 lines
'ASCII TABLE DISPLAY PROGRAM
'S.McLachlan, Jul 89
WINDOW 1,"ASCII - S.McLachlan",(0,0)-(230,146),6
DIM c$(255)
LINE (0,0)-(230,146),3,BF
GOSUB init
scr:
COLOR 2,3
LOCATE 1,1:PRINT " DEC HEX CHAR DEC HEX CHAR"
COLOR 0,1
FOR l%= 0 TO 15
LOCATE l%+2,2
IF (start+l%)<100 THEN PRINT " ";
IF (start+l%)<10 THEN PRINT " ";
PRINT start+l%
LOCATE l%+2,8
h$=HEX$(start+l%):IF (start+l%)<16 THEN h$="0"+h$
PRINT h$
LOCATE l%+2,11
PRINT c$(start+l%)
LOCATE l%+2,16
IF (start+l%+16)<100 THEN PRINT " ";
IF (start +l%+16)<10 THEN PRINT " ";
PRINT start+l%+16
LOCATE l%+2,22
h$=HEX$(start+l%+16):IF (start+l%+16)<16 THEN h$="0"+h$
PRINT h$
LOCATE l%+2,25
PRINT c$(start+l%+16);
NEXT
waitloop:
if inkey$<>"" goto waitloop
SLEEP
a$=INKEY$
if a$=chr$(27) then clear:end
IF a$= CHR$(28) THEN
ch=1
start=start-32
IF start<0 THEN start=0:ch=0
END IF
IF a$=CHR$(29) THEN
ch=1
start=start+32
IF start>224 THEN start=224:ch=0
END IF
IF ch=1 THEN
GOTO scr
ELSE
GOTO waitloop
end if
init:
FOR l%=0 TO 31
READ c$(l%)
NEXT
FOR l%=32 TO 128
c$(l%)=" "+CHR$(l%)+" "
NEXT
FOR l%=129 TO 139
READ c$(l%)
NEXT
FOR l%=140 TO 255
c$(l%)=" "+CHR$(l%)+" "
NEXT
start=0:ch=1
RETURN
DATA "NUL","SOH","STX","ETX","EOT","ENQ","ACK","BEL","BS ","HT ","LF ","VT ","FF "
DATA "CR ","SO ","SI ","DLE","DC1","DC2","DC3","DC4","NAK","SYN","ETB","CAN"
DATA "EM ","SUB","ESC","CuU","CuD","CuR","CuL"
DATA "F1 ","F2 ","F3 ","F4 ","F5 ","F6 ","F7 ","F8 ","F9 ","F10","HLP"